import { ID,KEY,BASE } from "../config";

export const $http = (url,method='GET')=>{
	return new Promise((resolve,reject)=>{
		uni.request({
			url:`${BASE}/1.1/${url}`,
			method,
			header:{
				'X-LC-Id':ID,
				'X-LC-Key':KEY,
				'content-type':'application/json'
			},
			success: (res) => {
				resolve(res)
			},
			fail: (err) => {
				reject(err)
			}
		})
	})
}